{{ extend './common/layout.html' }}

{{ block 'main' }}

{{ include './common/header.html' }}
<!-- 主体内容 -->
<div class="content">
    {{ include './common/aside.html' }}
    <div class="main">
        <!-- 分类标题 -->
        <div class="title">
            <h4> 修改用户：{{ user.username }}</h4>
            <span>找到1个用户</span>
            <p class="tips">{{message}}</p>
        </div>
        <!-- /分类标题 -->
        <form class="form-container" method="POST" action="/admin/user/edit">
            <input type="hidden" name="id" value="{{ user._id + '' }}">
            <div class="form-group">
                <label>用户名</label>
                <input type="text" class="form-control" placeholder="请输入用户名" name="username" value={{user.username}}>
            </div>
            <div class="form-group">
                <label>邮箱</label>
                <input type="email" value={{user.email}} class="form-control" placeholder="请输入邮箱地址" name="email">
            </div>
            <div class="form-group">
                <label>密码</label>
                <input type="password" value={{user.password}} class="form-control" placeholder="请输入密码" name="password">
            </div>
            <div class="form-group">
                <label>角色</label>
                <select class="form-control" name="role">
                    <option value="normal" {{user && user.role == 'normal' ? 'selected' : ''}}>普通用户</option>
                    <option value="admin" {{user && user.role == 'admin' ? 'selected' : ''}}>超级管理员</option>
                </select>
            </div>
            <div class="form-group">
                <label>状态</label>
                <select class="form-control" name="status">
                    <option value="1" {{user && user.status == '1' ? 'selected' : ''}}>启用</option>
                    <option value="0" {{user && user.status == '0' ? 'selected' : ''}}>禁用</option>
                </select>
            </div>
            <div class="buttons">
                <input type="submit" class="btn btn-primary">
            </div>
        </form>
    </div>
</div>
<!-- /主体内容 -->

{{ /block }}